﻿-- ===================================================================
-- Stored procedure that creates an encryption key
-- The name of the Symmetric key will always be 'Zen4SyncSymmetricKey'
-- The password will be given as an input parameter.
-- ===================================================================

CREATE Procedure [Admin].sp_z4s_create_encryption_key
@password nvarchar(300)
As

BEGIN
	set nocount on

	Declare @sql nvarchar(1000)
	set @sql='
	Create Symmetric Key Zen4SyncSymmetricKey
	With algorithm= TRIPLE_DES encryption
	By password='''+@password+''''

	exec [dbo].[sp_executesql] @sql

	set nocount off
end 